package selenium;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.channels.FileChannel;

import org.apache.commons.lang3.StringUtils;

import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.EncoderException;
import it.sauronsoftware.jave.InputFormatException;

public class yidongFiles {
	// 去除下载重复的视频       
	//private static final String baidu = "115.239.211.112";

	public static void main(String[] args) {
		
		
		//getNetworkState(baidu);
		// *********************唯一需要更改的地方********************
		String filepath = "E:\\西瓜视频下载\\西瓜视频\\移动";// E:\分类视频采集王\好看视频\搞笑
		// *********************唯一需要更改的地方********************
		String filepath2 = "E:\\西瓜视频下载\\西瓜视频\\影视";// E:\分类视频采集王\好看视频\搞笑
		
			File file = new File(filepath);
			String[] filelist = file.list();
			for (int i = 0; i < filelist.length; i++) {
				String string = filelist[i];
				System.gc();
				System.out.println("长度为-----"+filelist.length);
				File file1 = new File(filepath+"/"+string);
				String[] filelist2 = file1.list();
				for (String string2 : filelist2) {
					System.out.println("长度为-----"+filelist2.length);
					File file2 = new File(filepath+"/"+string+"/"+string2);
					System.out.println("---------------移动---------------------");
					System.gc();
					file2.renameTo(new File(filepath2 +"/"+ file2.getName()));
				}
			}
	}
}
